home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / hulk.swf / scripts / com / soap / net / Mochi.as < prev   
Encoding:
Text File  |  2010-04-12  |  1.9 KB  |  65 lines

  1. package com.soap.net
  2. {
  3.    import flash.display.DisplayObject;
  4.    import flash.display.Loader;
  5.    import flash.events.IOErrorEvent;
  6.    import flash.net.URLRequest;
  7.    import flash.net.URLRequestMethod;
  8.    import flash.net.URLVariables;
  9.    import flash.system.Capabilities;
  10.    import flash.system.Security;
  11.    
  12.    public class Mochi
  13.    {
  14.       
  15.       private static var self:Mochi;
  16.        
  17.       
  18.       public function Mochi()
  19.       {
  20.          super();
  21.       }
  22.       
  23.       public static function track(param1:DisplayObject, param2:String) : Mochi
  24.       {
  25.          var _loc3_:String = null;
  26.          var _loc4_:URLVariables = null;
  27.          var _loc5_:String = null;
  28.          var _loc6_:URLRequest = null;
  29.          var _loc7_:Loader = null;
  30.          if(Security.sandboxType == "localWithFile")
  31.          {
  32.             return null;
  33.          }
  34.          self = new Mochi();
  35.          Security.allowDomain("*");
  36.          Security.allowInsecureDomain("*");
  37.          _loc3_ = "http://core.mochibot.com/my/core.swf";
  38.          (_loc4_ = new URLVariables())["sb"] = Security.sandboxType;
  39.          _loc4_["v"] = Capabilities.version;
  40.          _loc4_["swfid"] = param2;
  41.          _loc4_["mv"] = "8";
  42.          _loc4_["fv"] = "9";
  43.          if((_loc5_ = param1.loaderInfo.loaderURL).indexOf("http") == 0)
  44.          {
  45.             _loc4_["url"] = _loc5_;
  46.          }
  47.          else
  48.          {
  49.             _loc4_["url"] = "local";
  50.          }
  51.          (_loc6_ = new URLRequest(_loc3_)).contentType = "application/x-www-form-urlencoded";
  52.          _loc6_.method = URLRequestMethod.POST;
  53.          _loc6_.data = _loc4_;
  54.          (_loc7_ = new Loader()).contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,error);
  55.          _loc7_.load(_loc6_);
  56.          return self;
  57.       }
  58.       
  59.       private static function error(param1:IOErrorEvent) : void
  60.       {
  61.          trace("error " + param1.text);
  62.       }
  63.    }
  64. }
  65.